<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>寝室</title>
    
    <meta name="viewport" content="width=device-width,initial-scale=1" />
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/navs.css">
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/default.css">
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/f/assignment.css"/>
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
  </head>
  <body>
  <div class="all">
  	<jsp:include page="/nav.jsp"></jsp:include>
	  	<div class="rightall float-left">
		  	<div class="already">
			  	<div class="already-title">
					<div class="left">寝室考勤 </div>
				</div>
				    	<table class="table">	
							<tr class="tr-style-head">
								<td>寝室ID</td>
								<td>寝室名称</td>
								<td>学年</td>
								<td>周次</td>
								<td>是否为优秀寝室</td>
							</tr>
							<c:forEach items="${dorm }" var="s">
							<tr class="tr-style">
								<td>${s.dormId }</td>
								<td>${s.dormName }</td>
								<td>${s.checkTerm }</td>
								<td>${s.checkMonth }</td>
								<c:if test="${s.dormState==1 }">
									<td style="color:red;">不是</td>
								</c:if>
								<c:if test="${s.dormState==2 }">
									<td style="color:blue;">是</td>
								</c:if>
							</tr>
							</c:forEach>
						</table>
						<c:if test="${pages > 1 }">
		               		<div class="previous">
			               		<c:if test="${pageNo>1}">
			                    	<a href="student/dorm.do?pageNo=${pageNo - 1}">上一页</a>
			                	</c:if>
			                   	<c:forEach var="p" begin="1" end="${pages }" step="1">
			                   		<c:if test="${p==pageNo }">
			                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
			                   		</c:if>
			                   		<c:if test="${p!=pageNo }">
			                   			<a href="student/dorm.do?pageNo=${p }" >&nbsp;${p}&nbsp;</a>
			                   		</c:if>
			                   	</c:forEach>
			                    <c:if test="${pageNo<pages}">
			                    	<a href="student/dorm.do?pageNo=${pageNo + 1 }">下一页</a>
			                	</c:if>
		                   	</div>
		                </c:if>
				</div>
			</div>
	</div>
  </body>
</html>
